<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script>
        // 获取时间
        // const date = new Date();
        // const year = date.getFullYear()
        // const month = date.getMonth()
        // console.log(year)
        // console.log(month + 1)

        // 获取时间戳
        // const date = new Date()
        // console.log(date.getTime())
        // console.log(+new Date())
        // console.log(Date.now())

        // function getFormattedCurrentDateTime() {
        //     const now = new Date();
        //     const year = now.getFullYear();
        //     const month = String(now.getMonth() + 1).padStart(2, '0');
        //     const day = String(now.getDate()).padStart(2, '0');
        //     const hours = String(now.getHours()).padStart(2, '0');
        //     const minutes = String(now.getMinutes()).padStart(2, '0');
        //     const seconds = String(now.getSeconds()).padStart(2, '0');
        //     return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
        // }
        // console.log(getFormattedCurrentDateTime());


    </script>
</body>

</html>